package fr.grassaud.hmvc.test;

import java.util.List;
import java.util.Map;

import fr.grassaud.hmvc.event.HMVCEvent;
import fr.grassaud.hmvc.info.TriadInfo;
import fr.grassaud.hmvc.session.HMVCSessionImpl;
import fr.grassaud.hmvc.session.Triad;
import fr.grassaud.hmvc.session.TriadImpl;

public class MockTriad implements Triad {

    private Triad triad;

    public MockTriad(Class<?> controllerClass, HMVCSessionImpl session) {
	triad = new TriadImpl(controllerClass, session);
    }

    @Override
    public boolean consumeEvent(HMVCEvent event) {
	return triad.consumeEvent(event);
    }

    @Override
    public boolean canConsumeEvent(HMVCEvent event) {
	return triad.canConsumeEvent(event);
    }

    @Override
    public Map<String, Triad> getChildren() {
	return triad.getChildren();
    }

    @Override
    public <T> T getController() {
	return triad.getController();
    }

    @Override
    public <T> T getModel() {
	return triad.getModel();
    }

    @Override
    public <T> T getView() {
	return triad.getView();
    }

    @Override
    public void setParent(Triad parent) {
	triad.setParent(parent);

    }

    @Override
    public Triad getParent() {
	return triad.getParent();
    }

    @Override
    public boolean hasComponent(Object o) {
	return triad.hasComponent(o);
    }

    @Override
    public List<Triad> getTriadWithController(Class<?> controllerClass) {
	return triad.getTriadWithController(controllerClass);
    }

    @Override
    public void instantiate() {
	triad.instantiate();

    }

    @Override
    public TriadInfo getTriadInfo() {
	return triad.getTriadInfo();
    }

    @Override
    public void release(HMVCEvent event) {
	triad.release(event);
	
    }
    
    
    public String getName() {
	return this.triad.getName();
    }

    @Override
    public void removeChild(Triad t) {
	triad.removeChild(t);
	
    }
    
    

}
